﻿using System.Linq;
using WeBlog.Interfaces;
using WeBlog.Repositories;

namespace WeBlog.Models
{
    public class PageListViewModel : GridModel<Page>
    {
        private PageRepository _pageRepository;

        public PageListViewModel(GridSettings settings, IUnitOfWork unitOfWork) :
            base(settings)
        {
            settings.DefaultSortColumn = "Title";
            _pageRepository = new PageRepository(unitOfWork);
        }

        public override IQueryable<Page> GetSuperSet()
        {
            return _pageRepository.FindAll();
        }
    }
}